package be.itoffice.mbt.persist.adapter;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class JsonDateAdapter extends XmlAdapter<String, Date> {

	private final static DateFormat DF = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");

	@Override
	public Date unmarshal(String s) throws Exception {
		return DF.parse(s);
	}

	@Override
	public String marshal(Date d) throws Exception {
		return DF.format(d);
	}

}
